<script setup lang="ts">
// 生意参谋-搜索客群-客群属性画像

import {getCurrentInstance} from "vue";
import BaseApp from "~/contentScripts/views/sycm/baseApp.vue";
import User from "~/contentScripts/views/tao/list/components/user.vue";
import {isLogin} from "~/logic";
import SYCM from "~/utils/ali/sycm";

const {proxy} = getCurrentInstance();
const $req = proxy.$req;
const loginVisible = ref<Boolean>(false);
const tabs = ref<any[]>([]);
const __option = getCurrentInstance()?.appContext.provides.option;
const handle = async () => {
  if (isLogin({
    emit: () => {
      loginVisible.value = true;
    }
  }, __option)) {
    let data = document.querySelectorAll("#completeShopPortrait > div.oui-card-content > span > div > div.ant-radio-group.ant-radio-group-outline input.ant-radio-input");
    data.forEach((el) => {
      let _el = el as HTMLInputElement;
      tabs.value.push({
        value: _el.value,
        checked: _el.checked,
        data: _el.checked ? loadData() : undefined,
      })
    })
    console.log(await SYCM.getInternalFiberData('#completeShopPortrait > div.oui-card-content > span', 'memoizedProps.children.props'))
  }
}
const loadData = async () => {
  return await SYCM.getInternalFiberData('#completeShopPortrait > div.oui-card-content > span', 'memoizedProps.children.props');
}

</script>

<template>
  <base-app>
    <a-button-group>
      <user style="margin-right: 0;"/>
      <a-button type="primary" size="small" @click="handle">
        一键转化
      </a-button>
    </a-button-group>
  </base-app>
</template>

<style scoped>

</style>
